Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngr: Fix Gradle test runner by only _conditionally_ invoking gradle wrapper #27

Merged
merged 3 commits into from
Nov 24, 2023

Conversation

amotl
Copy link
Member

@amotl amotl commented Nov 23, 2023

Introduction

In order to support projects not including a Gradle wrapper, invoking gradle wrapper was sufficient to create one.

Problem

However, this leads to problems on other projects which include a wrapper already:

Could not set unknown property 'baseName' for task ':jar' of type org.gradle.api.tasks.bundling.Jar.

-- https://github.com/crate/crate-sample-apps/actions/runs/6974312523/job/18979796291#step:5:40

Solution

This patch intends to improve the situation by only installing a wrapper when ngr does not find a gradlew file in the directory.

References

This improvement has been seeded from a real project, where it is already used and verified on.

Copy link

codecov bot commented Nov 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4f47844) 88.59% compared to head (f04eed7) 88.59%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #27   +/-   ##
=======================================
  Coverage   88.59%   88.59%           
=======================================
  Files          17       17           
  Lines         561      561           
=======================================
  Hits          497      497           
  Misses         64       64           
Flag Coverage Δ
main 74.50% <0.00%> (ø)
ngr 72.54% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

In order to support projects not including a Gradle wrapper, invoking
`gradle wrapper` was sufficient to create one.

However, this leads to problems on other projects which include a
wrapper already:

> Could not set unknown property 'baseName' for task ':jar' of type org.gradle.api.tasks.bundling.Jar.
>
> -- https://github.com/crate/crate-sample-apps/actions/runs/6974312523/job/18979796291#step:5:40

This patch intends to improve the situation by only installing a wrapper
when ngr does not find a `gradlew` file in the directory.
@amotl amotl requested review from seut and matriv November 24, 2023 12:12
@amotl amotl marked this pull request as ready for review November 24, 2023 12:18
@amotl amotl changed the title ngr: Fix Gradle test runner by conditionally invoking gradle wrapper ngr: Fix Gradle test runner by only _conditionally_ invoking gradle wrapper Nov 24, 2023
@amotl amotl merged commit 285ab7a into main Nov 24, 2023
6 checks passed
@amotl amotl deleted the more-gradle branch November 24, 2023 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants